package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
//    @NotNull(message = "用户名不能为null")
//    @NotEmpty(message = "用户名不能为空字符串和null")
//    @Size(min = 3, max = 10,message = "用户名长度必须在3-10之间")
    @Pattern(regexp = "^([a-zA-Z]{1,14}|[\\u4e00-\\u9fa5]{1,7})$",message = "用户名必须是1-14个字母或1-7个中文")
    @Schema(description = "用户名",required = true)
    private String username;
    @Schema(description = "密码",required = true)
    private String password;
    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",message = "邮箱格式错误")
    @Schema(description = "邮箱",required = true)
    private String email;
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式错误")
    @Schema(description = "手机号",required = true)
    private String phone;
}
